<template>
  <view class="card flex" @click="toDetail">
    <image
      class="poster"
      :src="info.verticpic"
    />
    <image
      src="../../../assets/images/icons/dy.png"
      class="c-img"
      v-if="info.channelType === 0"
    />
    <image
      src="../../../assets/images/icons/kuaishou.png"
      class="c-img"
      v-if="info.channelType == 1"
    />
    <image
      src="../../../assets/images/icons/wx.png"
      class="c-img"
      v-if="info.channelType == 2"
    />
    <view class="info">
      <view class="name bold ellipsis">{{ info.taskName }}</view>
      <view>
        <text class="inc">累计收益：</text>
        <text class="money orange">￥{{ info.totalIncome || 0 }}</text>
      </view>
      <view class="income flex">
        <view class="item flex flex-c" v-if="[22,24].includes(info.mountType)">
          <text class="type" >分成比例({{ info.distributeRate || 0 }}%)</text>
          <!-- <text class="orange">￥{{ info.dyMaPromotionPlanIncome || 0 }}</text> -->
        </view>
        <view v-if="info.mountType == 23">请去快手聚星平台查询</view>
        <!-- <view class="item flex flex-c">
          <text class="type">平台补贴({{ info.distributeRate }}%)</text>
          <text class="orange">￥{{ info.dyMaPromotionPlanIncom || 0 }}</text>
        </view> -->
      </view>
      <view class="date flex flex-bt flex-a">
        <view class="id-box flex flex-c flex-bt">
          <view class="id gray">任务ID：{{ info.id }}</view>
          <view class="gray">创建时间：{{ info.createdTime }}</view>
        </view>
        <view class="flex flex-c flex-a-c btn">
          <image
            src="../../../assets/images/icons/send.png"
            mode="scaleToFill"
            style="width: 32rpx; height: 32rpx; margin-top: 8rpx"
          />
          <text class="fs-24">去投稿</text>
        </view>
      </view>
    </view>
  </view>
</template>
<script>
export default {
  props: {
    info: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {};
  },
  methods: {
    toDetail() {
      console.log("----");
      uni.navigateTo({
        url: `/pages/extend/detail/index?id=${this.info.vid}`,
      });
    },
  },
};
</script>
<style lang="less" scoped>
@import url("../../../assets/styles/common");
.card {
  padding: 20rpx;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 8rpx;
  margin-bottom: 24rpx;
  position: relative;
  .c-img{
    position: absolute;
    width:32rpx;
    height: 32rpx;
    top:32rpx;
    left:32rpx;
  }
  .poster {
    width: 204rpx;
    height: 272rpx;
    border-radius: 8rpx;
    flex-shrink: 0;
  }
  .info {
    width: calc(100% - 204rpx);
    padding-left: 16rpx;
    flex: 1;
    .name {
      display: block;
      flex: 1;
      font-size: 32rpx;
      line-height: 32rpx;
      margin-bottom: 8rpx;
    }
    .gray {
      color: rgba(7, 11, 28, 0.4);
      font-size: 22rpx;
    }
    .orange {
      color: #f65900;
      font-weight: bold;
    }
    .inc {
      font-size: 24rpx;
      font-weight: bold;
      color: rgba(7, 11, 28, 0.6);
    }
    .money {
      font-size: 28rpx;
    }
    .income {
      padding-right: 0;
      margin-top: 8rpx;
      .item {
        background: #f5f5ff;
        border-radius: 8rpx;
        padding: 8rpx 12rpx;
        flex: 1;
        .orange {
          font-size: 24rpx;
        }
        &:nth-child(1) {
          margin-right: 8rpx;
        }
        .type {
          font-size: 24rpx;
          color: rgba(7, 11, 28, 0.6);
        }
      }
    }
    .date {
      .id-box {
        height: 44rpx;
      }
      padding-right: 24rpx;
      .id {
        // margin-bottom: 4rpx;
      }
    }
    .btn {
      color: #436af3;
    }
  }
}
</style>
